package com.yugao.fintech.antelope.base.datasource;

import com.yugao.fintech.antelope.base.model.module.mq.AbstractMQ;
import com.yugao.fintech.antelope.base.model.module.mq.BaseMqPayload;
import lombok.*;

/**
 * 定义MQ消息格式
 * 业务场景： 删除应用
 *
 * @deprecated
 */
@Getter
@Setter
public class AppDeleteMQ extends AbstractMQ {
    public static final String EXCHANGE = "workspace.delete.exchange";
    public static final String KEY = "";

    public AppDeleteMQ(MsgPayload msgPayload) {
        super(msgPayload);
    }

    /**
     * 定义Msg消息载体
     */
    @Data
    @Builder
    @EqualsAndHashCode(callSuper = true)
    @AllArgsConstructor
    @NoArgsConstructor
    public static class MsgPayload extends BaseMqPayload {
        /**
         * 删除的应用id
         */
        private Long appId;
    }

    /**
     * 构造MQModel , 一般用于发送MQ时
     */
    public static AppDeleteMQ build(Long appId) {
        return new AppDeleteMQ(new MsgPayload(appId));
    }
}
